package com.daxiong.model;

/**
 * 客户信息
 *
 * @author sunyanxiong
 * @date 2017/4/28
 */
public class ClientInfo {

    private String id;
    private String name;
    private String shortName;
    private String address;
    private String postcode;
    private String telphone;
    private String fax;
    private String cantact;
    private String cantactPhone;
    private String email;
    private String bank;
    private String bankAccount;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getShortName() {
        return shortName;
    }

    public void setShortName(String shortName) {
        this.shortName = shortName;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPostcode() {
        return postcode;
    }

    public void setPostcode(String postcode) {
        this.postcode = postcode;
    }

    public String getTelphone() {
        return telphone;
    }

    public void setTelphone(String telphone) {
        this.telphone = telphone;
    }

    public String getFax() {
        return fax;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public String getCantact() {
        return cantact;
    }

    public void setCantact(String cantact) {
        this.cantact = cantact;
    }

    public String getCantactPhone() {
        return cantactPhone;
    }

    public void setCantactPhone(String cantactPhone) {
        this.cantactPhone = cantactPhone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getBank() {
        return bank;
    }

    public void setBank(String bank) {
        this.bank = bank;
    }

    public String getBankAccount() {
        return bankAccount;
    }

    public void setBankAccount(String bankAccount) {
        this.bankAccount = bankAccount;
    }

    @Override
    public String toString() {
        return getName();
    }

    // 重写 hashCode()
    @Override
    public int hashCode() {
        final int PRIME = 31;
        int result = 1;
        result = PRIME * result + ((null == id) ? 0 : id.hashCode());
        result = PRIME * result + ((null == name) ? 0 : name.hashCode());
        result = PRIME * result + ((null == shortName) ? 0 : shortName.hashCode());
        result = PRIME * result + ((null == address) ? 0 : address.hashCode());
        result = PRIME * result + ((null == postcode) ? 0 : postcode.hashCode());
        result = PRIME * result + ((null == telphone) ? 0 : telphone.hashCode());
        result = PRIME * result + ((null == fax) ? 0 : fax.hashCode());
        result = PRIME * result + ((null == cantact) ? 0 : cantact.hashCode());
        result = PRIME * result + ((null == cantactPhone) ? 0 : cantactPhone.hashCode());
        result = PRIME * result + ((null == email) ? 0 : email.hashCode());
        result = PRIME * result + ((null == bank) ? 0 : bank.hashCode());
        result = PRIME * result + ((null == bankAccount) ? 0 : bankAccount.hashCode());
        return result;
    }

    // 重写 equals()
    @Override
    public boolean equals(Object object) {
        if (object == this) {
            return true;
        }
        if (null == this) {
            return false;
        }
        if (object.getClass() != getClass()) {
            return false;
        }

        final ClientInfo clientInfo = (ClientInfo) object;
        if (null == id) {
            if (null != clientInfo.id) {
                return false;
            }
        } else if (!id.equals(clientInfo.id)) {
            return false;
        }

        if (null == name) {
            if (null != clientInfo.name) {
                return false;
            }
        } else if (!name.equals(clientInfo.name)) {
            return false;
        }

        if (null == shortName) {
            if (null != clientInfo.shortName) {
                return false;
            }
        } else if (!shortName.equals(clientInfo.shortName)) {
            return false;
        }

        if (null == address) {
            if (null != clientInfo.address) {
                return false;
            }
        } else if (!address.equals(clientInfo.address)) {
            return false;
        }

        if (null == postcode) {
            if (null != clientInfo.postcode) {
                return false;
            }
        } else if (!postcode.equals(clientInfo.postcode)) {
            return false;
        }


        if (null == telphone) {
            if (null != clientInfo.telphone) {
                return false;
            }
        } else if (!telphone.equals(clientInfo.telphone)) {
            return false;
        }

        if (null == fax) {
            if (null != clientInfo.fax) {
                return false;
            }
        } else if (!fax.equals(clientInfo.fax)) {
            return false;
        }

        if (null == cantact) {
            if (null != clientInfo.cantact) {
                return false;
            }
        } else if (!cantact.equals(clientInfo.cantact)) {
            return false;
        }

        if (null == cantactPhone) {
            if (null != clientInfo.cantactPhone) {
                return false;
            }
        } else if (!cantactPhone.equals(clientInfo.cantactPhone)) {
            return false;
        }

        if (null == email) {
            if (null != clientInfo.email) {
                return false;
            }
        } else if (!email.equals(clientInfo.email)) {
            return false;
        }

        if (null == bank) {
            if (null != clientInfo.bank) {
                return false;
            }
        } else if (!bank.equals(clientInfo.bank)) {
            return false;
        }

        if (null == bankAccount) {
            if (null != clientInfo.bankAccount) {
                return false;
            }
        } else if (!bankAccount.equals(clientInfo.bankAccount)) {
            return false;
        }
        return true;
    }
}
